unit CatPesoFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TfrmCatPeso = class(TForm)
    boxMain: TPanel;
    lblRagazziM: TLabel;
    lblRagazziF: TLabel;
    lblEsordientiAM: TLabel;
    lblEsordientiAF: TLabel;
    lblEsordientiBM: TLabel;
    lblEsordientiBF: TLabel;
    lblCadettiAM: TLabel;
    lblCadettiF: TLabel;
    lblJuniorM: TLabel;
    lblJuniorF: TLabel;
    lblSeniorM: TLabel;
    lblSeniorF: TLabel;
    boxCommand: TPanel;
    btnOk: TButton;
    btnAnnulla: TButton;
    lstRagazziM: TMemo;
    lstRagazziF: TMemo;
    lstEsordientiAM: TMemo;
    lstEsordientiAF: TMemo;
    lstEsordientiBM: TMemo;
    lstEsordientiBF: TMemo;
    lstCadettiM: TMemo;
    lstCadettiF: TMemo;
    lstJuniorM: TMemo;
    lstJuniorF: TMemo;
    lstSeniorM: TMemo;
    lstSeniorF: TMemo;
    lblBambini: TLabel;
    lstBambini: TMemo;
    lblUnder19M: TLabel;
    lstUnder19M: TMemo;
    lblUnder19F: TLabel;
    lstUnder19F: TMemo;
    boxTitle: TPanel;
    lblTitle: TLabel;
    edtTitle: TEdit;
    ScrollBox: TScrollBox;
    lblMasterM1: TLabel;
    lstMasterM1: TMemo;
    lblMasterF1: TLabel;
    lstMasterF1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    function GetTitle: string;
    procedure SetTitle(const Value: string);
  public
    property Title: string read GetTitle write SetTitle;
  end;

var
  frmCatPeso: TfrmCatPeso;

implementation

{$R *.dfm}

uses
  JudoMod;

procedure TfrmCatPeso.FormCreate(Sender: TObject);
begin
  lstBambini.Lines.Text := modJudo.GetCatPesoList(catBambini);
  lstUnder19M.Lines.Text := modJudo.GetCatPesoList(catUnder19M);
  lstUnder19F.Lines.Text := modJudo.GetCatPesoList(catUnder19F);
  lstRagazziM.Lines.Text := modJudo.GetCatPesoList(catRagazziM);
  lstRagazziF.Lines.Text := modJudo.GetCatPesoList(catRagazziF);
  lstEsordientiAM.Lines.Text := modJudo.GetCatPesoList(catEsAM);
  lstEsordientiAF.Lines.Text := modJudo.GetCatPesoList(catEsAF);
  lstEsordientiBM.Lines.Text := modJudo.GetCatPesoList(catEsBM);
  lstEsordientiBF.Lines.Text := modJudo.GetCatPesoList(catEsBF);
  lstCadettiM.Lines.Text := modJudo.GetCatPesoList(catCadettiM);
  lstCadettiF.Lines.Text := modJudo.GetCatPesoList(catCadettiF);
  lstJuniorM.Lines.Text := modJudo.GetCatPesoList(catJuniorM);
  lstJuniorF.Lines.Text := modJudo.GetCatPesoList(catJuniorF);
  lstSeniorM.Lines.Text := modJudo.GetCatPesoList(catSeniorM);
  lstSeniorF.Lines.Text := modJudo.GetCatPesoList(catSeniorF);
  lstMasterM1.Lines.Text := modJudo.GetCatPesoList(catMasterM1);
  lstMasterF1.Lines.Text := modJudo.GetCatPesoList(catMasterF1);
end;

procedure TfrmCatPeso.FormDestroy(Sender: TObject);
begin
  if ModalResult = mrOk then
  begin
    modJudo.SetCatPesoList(catBambini, lstBambini.Lines.Text);
    modJudo.SetCatPesoList(catUnder19M, lstUnder19M.Lines.Text);
    modJudo.SetCatPesoList(catUnder19F, lstUnder19F.Lines.Text);
    modJudo.SetCatPesoList(catRagazziM, lstRagazziM.Lines.Text);
    modJudo.SetCatPesoList(catRagazziF, lstRagazziF.Lines.Text);
    modJudo.SetCatPesoList(catEsAM, lstEsordientiAM.Lines.Text);
    modJudo.SetCatPesoList(catEsAF, lstEsordientiAF.Lines.Text);
    modJudo.SetCatPesoList(catEsBM, lstEsordientiBM.Lines.Text);
    modJudo.SetCatPesoList(catEsBF, lstEsordientiBF.Lines.Text);
    modJudo.SetCatPesoList(catCadettiM, lstCadettiM.Lines.Text);
    modJudo.SetCatPesoList(catCadettiF, lstCadettiF.Lines.Text);
    modJudo.SetCatPesoList(catJuniorM, lstJuniorM.Lines.Text);
    modJudo.SetCatPesoList(catJuniorF, lstJuniorF.Lines.Text);
    modJudo.SetCatPesoList(catSeniorM, lstSeniorM.Lines.Text);
    modJudo.SetCatPesoList(catSeniorF, lstSeniorF.Lines.Text);
    modJudo.SetCatPesoList(catSeniorM, lstSeniorM.Lines.Text);
    modJudo.SetCatPesoList(catSeniorF, lstSeniorF.Lines.Text);
    modJudo.SetCatPesoList(catMasterM1, lstMasterM1.Lines.Text);
    modJudo.SetCatPesoList(catMasterF1, lstMasterF1.Lines.Text);

  end;
end;

function TfrmCatPeso.GetTitle: string;
begin
  Result := edtTitle.Text;
end;

procedure TfrmCatPeso.SetTitle(const Value: string);
begin
  edtTitle.Text := Value;
end;

end.
